<ui:composition xmlns="http://www.w3.org/1999/xhtml"
 	 xmlns:h="http://java.sun.com/jsf/html"      
     xmlns:f="http://java.sun.com/jsf/core"
     xmlns:p="http://primefaces.org/ui"
     xmlns:ui="http://java.sun.com/jsf/facelets"
	 template="index.xhtml">
 <ui:define name="body">
 <script type="text/javascript">
	$(document).ready(function(){		
			$(".submenu-active").removeClass('submenu-active');
			$("#pointDeVente").addClass('submenu-active');
		});

	</script>
  <f:view>
 <h:form > 
                        
                        <h1>Points de vente </h1>
                        
                        
                        <h:form>
                    <h3>Création du Cadencement :</h3>
                    
                      Declarer, dans cette section ,les Cadencements Commande/ Mise en rayon ou Livraison/Mise en rayon par  
                        famille et par jour de commande.<br/> Exemple:je commande En Epicerie le Lundi pour mise en raon le mardi:
                        à l'intersection de la colonne "lundi" et de la ligne "Epicerie ", je clique <br/>et saisis les informations
                        souhaitées.
                    <br></br> <br></br>
            <p:treeTable value="#{documentsController.root}"  selection="#{documentsController.selectedNode}" selectionMode="single" var="document">  
        
        <p:column style="width:150px">  
            <f:facet name="header">  
                Nomenclature  
            </f:facet>  
            <h:outputText value="#{document.name}" />  
        </p:column>  
  
        <p:column style="width:50px">  
            <f:facet name="header">  
                Lundi 
            </f:facet> 
            <center>   <p:inputText  value="#{cadencement.e}" id="e" onclick="documentDialog.show()"  style=" width: 45px"/> </center>
          
           
           
           <p:dialog  widgetVar="documentDialog" >  
         
            
            
            <table border="0">
        
        
            <tr>
            
            <td width="100px"> <div align="left"><h:outputLabel  value="lundi"   style=" background-color: grey; color: whitesmoke ; size: 100px"/> </div> <br></br>
                </td>
                <td width="100px">  
              <div align="right">  <h:outputText id="name" value="#{documentsController.selectedNode.data.name}" style=" background-color: grey; color: whitesmoke ; size: 100px" /></div>
              
               
                </td>
               
            </tr>
            <tr>
                <td width="100px">Commande:  <br></br> </td>
                <td width="100px"><div align="right"> <p:inputText value="#{cadencement.b}"  id="b" style=" width: 30px"  >
                
                <p:ajax event="keyup" update="e" /> 
                
                
                </p:inputText></div></td>
            
            </tr>
            <tr>
                <td width="100px">Mise en rayon: <br></br></td>
                <td width="100px"><div align="right"> <h:selectOneMenu   id="p"  value="#{cadencement.p}" >
                                                            <f:selectItem itemLabel="A " itemValue="A" />  
                                                            <f:selectItem itemLabel="B" itemValue="B" />  
                                                            <f:selectItem itemLabel="C" itemValue="C" /> 
                                                            <p:ajax event="keyup" update="e" /> 
</h:selectOneMenu></div>
                </td>
            
             <br></br>
            </tr>
        
    </table>
            
            
              <br></br> <br></br> 
               
 <div align="right"> <p:commandButton value="Supprimer" /> 
     <p:commandButton value="Enregistrer"  oncomplete="documentDialog.hide()"    />  
  
  
  </div>
<br></br>
 

                
              
  
            <p:dataList value="#{documentsController.selectedNodes}"   
                        var="selectedNode" rendered="#{not empty documentsController.selectedNodes}">  
                #{selectedNode.data.name}  
            </p:dataList>  
        
    </p:dialog> 
        </p:column>  
  
  
  
    <p:column style="width:50px">  
            <f:facet name="header">  
                Mardi 
            </f:facet>  
          <center>  <p:inputText value="#{cadencement.e1}" id="e1"  onclick="ddocumentDialog.show()"  style="width: 45px"/></center> 
              <p:dialog  widgetVar="ddocumentDialog" >  
        <table border="0">
        
        
            <tr>
                <td width="100px"><div align="left">
                 <h:outputLabel for="mardi" value="Mardi" style=" background-color: grey; color: whitesmoke ; size: 100px"/> </div>
                </td>
                <td width="100px"><div align="right">
                <h:outputText id="namee" value="#{documentsController.selectedNode.data.name}"  style=" background-color: grey; color: whitesmoke ; size: 100px"/>
                
                </div> </td>
            </tr>
            <tr>
                <td width="100px"> Commande:  </td>
                <td width="100px"><p:inputText value="#{cadencement.b1}" style=" width: 30px" >
                <p:ajax event="keyup" update="e1" /> 
                </p:inputText></td>
            </tr>
            <tr>
                <td width="100px">Livraison: </td>
                <td width="100px"><h:selectOneMenu   value="#{cadencement.p1}" >
                                                            <f:selectItem itemLabel="A " itemValue="A" />  
                                                            <f:selectItem itemLabel="B" itemValue="B" />  
                                                            <f:selectItem itemLabel="C" itemValue="C" /> 
                                                            <p:ajax event="keyup" update="e1" /> 
</h:selectOneMenu></td>
            </tr>
        
    </table>
           
      <br></br>            
                
                <br></br>            
                
                
               
 <div align="right"> <p:commandButton value="Supprimer" onclick="ddocumentDialog.hide()"/>  
   <p:commandButton value="Enregistrer" onclick="ddocumentDialog.hide()"/></div>  
  
 
            <p:dataList value="#{documentsController.selectedNodes}"   
                        var="selectedNode" rendered="#{not empty documentsController.selectedNodes}">  
                #{selectedNode.data.name}  
            </p:dataList>  
        
    </p:dialog> 
            
            
        </p:column> 
                         <p:column style="width:50px">  
            <f:facet name="header">  
                Mercredi 
            </f:facet>  
                           <center>  <p:inputText value="#{ cadencement.e2}" id="e2" onclick="dddocumentDialog.show()" style="width: 45px"/> </center>
            <p:dialog  widgetVar="dddocumentDialog" >  
          
          <table border="0">
        
        
            <tr>
                <td><div align="left">
                 <h:outputLabel for="mercredi" value="Mercredi"  style=" background-color: grey; color: whitesmoke ; size: 100px"/>  
                </div></td>
                <td><div align="right">
                <h:outputText id="nameee" value="#{documentsController.selectedNode.data.name}" style=" background-color: grey; color: whitesmoke ; size: 100px" />
                </div></td>
            </tr>
            <tr>
                <td> Commande:  </td>
                <td><p:inputText value="#{cadencement.b2}" style=" width: 30px" >
                <p:ajax event="keyup" update="e2" /> 
                </p:inputText></td>
            </tr>
            <tr>
                <td>Livraison: </td>
                <td><h:selectOneMenu   value="#{cadencement.p2}" >
                <f:selectItem itemLabel="A " itemValue="A" />  
                <f:selectItem itemLabel="B" itemValue="B" />  
               	<f:selectItem itemLabel="C" itemValue="C" /> 
                
                <p:ajax event="keyup" update="e2" /> 
                                                            
</h:selectOneMenu></td>
            </tr>
        
    </table>
          
          
                
                
               
               
  <p:commandButton value="Supprimer" onclick="dddocumentDialog.hide()"/>  
   <p:commandButton value="Enregistrer" onclick="dddocumentDialog.hide()"/>  
  
 
<br></br>

            <p:dataList value="#{documentsController.selectedNodes}"   
                        var="selectedNode" rendered="#{not empty documentsController.selectedNodes}">  
                #{selectedNode.data.name}  
            </p:dataList>  
       
    </p:dialog> 
         
        </p:column> 
  <p:column style="width:50px">  
            <f:facet name="header">  
                Jeudi 
            </f:facet>  
            
      <center><p:inputText value="#{cadencement.e3}" id="e3" onclick="ddddocumentDialog.show()" style="width: 45px"/></center> 
            <p:dialog  widgetVar="ddddocumentDialog"> 
            
            <table border="0">
        
        
            <tr>
                <td width="100">
               <div align="left"> <h:outputLabel for="jeudi" value="Jeudi " style=" background-color: grey; color: whitesmoke ; size: 100px" /></div>  
                 </td>
                <td width="100"><div align="right">
               <h:outputText id="nameeee" value="#{documentsController.selectedNode.data.name}" style=" background-color: grey; color: whitesmoke ; size: 100px" />
                </div></td>
            </tr>
            <tr>
                <td width="100"> Commande:  </td>
                <td width="100"><p:inputText value="#{ cadencement.b3 }"  style=" width: 30px">
                 <p:ajax event="keyup" update="e3" /> 
                </p:inputText></td>
            </tr>
            <tr>
                <td width="100">Livraison: </td>
                <td width="100"><h:selectOneMenu  value="#{cadencement.p3}"  >
                                                            <f:selectItem itemLabel="A " itemValue="A" />  
                                                            <f:selectItem itemLabel="B" itemValue="B" />  
                                                            <f:selectItem itemLabel="C" itemValue="C" /> 
                                                             <p:ajax event="keyup" update="e3" /> 
</h:selectOneMenu></td>
            </tr>
        
    </table>
             
        
               
                
  <div align="right"><p:commandButton value="Supprimer" onclick="ddddocumentDialog.hide()"/>
  <p:commandButton value="Enregistrer" onclick="ddddocumentDialog.hide()"/></div>  
  
 
  
<br></br>



                
              
  
            <p:dataList value="#{documentsController.selectedNodes}"   
                        var="selectedNode" rendered="#{not empty documentsController.selectedNodes}">  
                #{selectedNode.data.name}  
            </p:dataList>  
        
    </p:dialog> 
              
        </p:column> 
                  <p:column style="width:50px">  
            <f:facet name="header">  
                Vendredi 
            </f:facet>  
                     <center> <p:inputText value="#{cadencement.e4}" id="e4" onclick="dddddocumentDialog.show()" style="width: 45px"/></center> 
            <p:dialog showEffect="fade" widgetVar="dddddocumentDialog" >
            <table border="0">
        
        
            <tr>
            <td width="100px">
                
                <div align="left"><h:outputLabel for="vendredi" value="Vendredi " style=" background-color: grey; color: whitesmoke ; size: 100px" />
                
                </div></td>
                <td width="100px">
                 
               <div align="right"> <h:outputText id="nameeeee" value="#{documentsController.selectedNode.data.name}" style=" background-color: grey; color: whitesmoke ; size: 100px" />
               </div> </td>
                
            </tr>
            <tr>
                <td width="100px">
                 Commande:  
                </td>
                <td><p:inputText value="#{cadencement.b4}" style=" width: 30px" >
                 <p:ajax event="keyup" update="e4" /> 
                </p:inputText></td>
            </tr>
            <tr>
                <td width="100px">Livraison: </td>
                <td width="100px"><h:selectOneMenu   value="#{cadencement.p4}"  >
                                                            <f:selectItem itemLabel="A " itemValue="A" />  
                                                            <f:selectItem itemLabel="B" itemValue="B" />  
                                                            <f:selectItem itemLabel="C" itemValue="C" /> 
                                                             <p:ajax event="keyup" update="e4" /> 
</h:selectOneMenu></td>
            </tr>
        
    </table>
            
              
        
                
               
 <div align="right"> <p:commandButton value="Supprimer" onclick="dddddocumentDialog.hide()"/> 
  <p:commandButton value="Enregistrer" onclick="dddddocumentDialog.hide()"/> </div> 
  
 
  
<br></br>



                
             
  
            <p:dataList value="#{documentsController.selectedNodes}"   
                        var="selectedNode" rendered="#{not empty documentsController.selectedNodes}">  
                #{selectedNode.data.name}  
            </p:dataList>  
         
    </p:dialog> 
     </p:column> 
           <p:column style="width:50px">  
            <f:facet name="header">  
                Samedi 
            </f:facet>  
              <center> <p:inputText value="#{cadencement.e5}" id="e5" onclick="ddddddocumentDialog.show()" style="width: 45px"/> </center>
            <p:dialog  widgetVar="ddddddocumentDialog" >  

                 <table border="0">
        
        
            <tr>
            
            
            <td width="100px">
           <div align="left">  
                <h:outputText id="samedi" value="#{documentsController.selectedNode.data.samedi}" style=" background-color: grey; color: whitesmoke ; size: 100px" />
           </div> </td>
                <td width="100px">
                
               <div align="right"> 
                <h:outputText id="nameeeeeee" value="#{documentsController.selectedNode.data.name}" style=" background-color: grey; color: whitesmoke ; size: 100px" />
               </div> </td>
                
            </tr>
            <tr>
                <td width="100px">
                 Commande:  
                </td>
                <td width="100px">
                    <h:inputText value="#{cadencement.b5}" style=" width: 30px" >
                     <p:ajax event="keyup" update="e5" /> 
                    </h:inputText>
                </td>
            </tr>
            <tr>
                <td width="100px">Livraison: </td>
                <td width="100px"><h:selectOneMenu  value="#{cadencement.p5}"  >
                                                            <f:selectItem itemLabel="A " itemValue="A" />  
                                                            <f:selectItem itemLabel="B" itemValue="B" />  
                                                            <f:selectItem itemLabel="C" itemValue="C" /> 
                                                             <p:ajax event="keyup" update="e5" /> 
</h:selectOneMenu></td>
            </tr>
        
    </table>

                
                
  <div align="right"><p:commandButton value="Supprimer" onclick="ddddddocumentDialog.hide()"/> 
    <p:commandButton value="Enregistrer" onclick="ddddddocumentDialog.hide()"/> </div> 
  
 
  
<br></br>



                
            
  
            <p:dataList value="#{documentsController.selectedNodes}"   
                        var="selectedNode" rendered="#{not empty documentsController.selectedNodes}">  
                #{selectedNode.data.name}  
            </p:dataList>  
      
    </p:dialog>  
      </p:column>               
                         
              <p:column style="width:50px">  
            <f:facet name="header">  
                Dimanche 
            </f:facet>  
                <center>  <p:inputText value="#{ cadencement.e6}" id="e6" onclick="dddddddocumentDialog.show()" style=" width: 45px"/> </center>
            <p:dialog  widgetVar="dddddddocumentDialog" >  
        <table border="1">
        
        
            <tr>
            
             <td width="100px">
               
              <div align="left">  <h:outputText id="dimanhe" value="#{documentsController.selectedNode.data.samedi}" style=" background-color: grey; color: whitesmoke ; size: 100px" />
             
            </div> </td>
                <td width="100px">
                
             <div align="right">   <h:outputText id="nameeeeee" value="#{documentsController.selectedNode.data.name}" style=" background-color: grey; color: whitesmoke ; size: 100px" />
               </div> </td>
               
            </tr>
            <tr>
                <td width="100px">
                Commande:  
                </td>
                <td width="100px"><h:inputText value="#{cadencement.b6}"  style=" width: 30px">
                 <p:ajax event="keyup" update="e6" /> 
                </h:inputText></td>
            </tr>
            <tr>
                <td width="100px">Livraison: </td>
                <td width="100px"><h:selectOneMenu   value="#{cadencement.p6}"  >
                                                            <f:selectItem itemLabel="A " itemValue="A" />  
                                                            <f:selectItem itemLabel="B" itemValue="B" />  
                                                            <f:selectItem itemLabel="C" itemValue="C" /> 
                                                             <p:ajax event="keyup" update="e6" /> 
</h:selectOneMenu></td>
            </tr>
        
    </table>
        
        
               
               
 <div align="right"> <p:commandButton value="Supprimer" onclick="dddddddocumentDialog.hide()"/> 
   <p:commandButton value="Enregestrer" onclick="dddddddocumentDialog.hide()"/>  
  
  </div>
  
<br></br>



                
            
  
            <p:dataList value="#{documentsController.selectedNodes}"   
                        var="selectedNode" rendered="#{not empty documentsController.selectedNodes}">  
                #{selectedNode.data.name}  
            </p:dataList>  
     
    </p:dialog>   
      </p:column>            
                     
                
                          
        
    </p:treeTable> 
                
     <br></br>
    
                   <table class="nostyle"><tr><td> <p:commandButton value="Enregistrer"/> </td><td><p:commandButton  value="Revenir à la liste des magasins " action="listePointDeVente.xhtml?faces-redirect=true}" ajax="false"/></td></tr></table>
            
            
                    
			 </h:form>
  </h:form>  
 
  </f:view>
  </ui:define>
  </ui:composition>